import { cloneDeep } from 'lodash-es';
export const defaultModel = (nodeModel: Object, defaultValue: Object) => {
  const model = cloneDeep(nodeModel);
  // console.log('defaultModel==model', model);
  // console.log('defaultModel==defaultValue', defaultValue);
  Object.keys(defaultValue).forEach((key) => {
    if (model[key] === null || model[key] === undefined) {
      model[key] = defaultValue[key];
    }
  });
  // console.log('defaultModel==model', model);
  // console.log('defaultModel==defaultValue', defaultValue);
  return model;
};
export default defaultModel;
